package br.ucb.connection;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class MyConnection {
	public static Connection getConnection() throws SQLException, ClassNotFoundException{
		Class.forName("com.mysql.jdbc.Driver");
		Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/LANCHONETE","root","root");
		return con;
	}
	public static void closeConnection(Connection con,Statement st) throws SQLException{
		con.close();
		st.close();
	}
	public static void closeConnection(Connection con,Statement st,ResultSet rs) throws SQLException{
		con.close();
		st.close();
		rs.close();
	}
}
